package com.hxk.demo.controller;

import cn.hutool.json.JSONObject;
import com.hxk.demo.dto.TongueCheckDTO;
import com.hxk.demo.service.TongueServiceI;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @author lyl
 */
@Slf4j
@RestController
@RequestMapping("/check")
public class TongueController {

    @Resource
    private TongueServiceI tongueServiceI;

    /**
     * 舌象检测
     *
     * @param dto 参数
     * @return JSONObject
     */
    @PostMapping(value = "/tongue")
    public JSONObject checkTongue(TongueCheckDTO dto) {
        return tongueServiceI.checkTongue(dto);
    }

    /**
     * 查询舌象检测结果
     *
     * @param tongueId 参数
     * @return JSONObject
     */
    @GetMapping("/tongueResult/{tongueId}")
    public JSONObject queryResult(@PathVariable("tongueId") String tongueId) {
        return tongueServiceI.tongueResult(tongueId);
    }
}
